package com.gitee.faster.webdav.kernel.model;

import jakarta.xml.bind.annotation.*;
import lombok.Data;
import lombok.experimental.Accessors;

/**
 * @author hongda.li
 */
@Data
@Accessors(chain = true)
@SuppressWarnings("SpellCheckingInspection")
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
        "collection"
})
@XmlRootElement(name = "resourcetype")
public class ResourceType {

    @XmlElement(name = "collection")
    private Collection collection;

    public static ResourceType ofFile() {
        return new ResourceType();
    }

    public static ResourceType ofDirectory() {
        ResourceType resourcetype = new ResourceType();
        resourcetype.setCollection(new Collection());
        return resourcetype;
    }
}
